<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">



<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>TRABALHO</title>
	<link href="css/main.css" rel="stylesheet" type="text/css"> 
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Uploadify Example Script</title>
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    <link href="css/uploadify.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="scripts/upload.js"></script>
    <script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="scripts/swfobject.js"></script>
    <script type="text/javascript" src="scripts/jquery.uploadify.v2.1.0.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
        $("#uploadimage").uploadify({
            'uploader'       : 'scripts/uploadify.swf',
            'script'         : 'scripts/uploadify.php',
            'cancelImg'      : 'img/cancel.png',
            'folder'         : 'storage/temp',
            'queueID'        : 'fileQueueimage',
            'auto'           : true,
            'multi'          : false,
            'queueSizeLimit' : 0,
            'simUploadLimit' : 1,
			'buttonText'     : 'Abrir',
            'onComplete'     : function(objEvent, strQueueID, objFile) {
        	$("#uploadimageUploader").attr("data","scripts/uploadify_disabled.swf");
            $("#uploadimage" + strQueueID + " .percentage").text(' - Completed');
            $("#uploadimage" + strQueueID + " .cancel a").attr('href', "javascript:jQuery('#uploadimage').uploadifyRemoveFromServer('" + strQueueID + "', '" + objFile.name + "')");
            return false;
            }

			
        });		
		$("#uploadfile").uploadify({
            'uploader'       : 'scripts/uploadify.swf',
            'script'         : 'scripts/uploadify.php',
            'cancelImg'      : 'img/cancel.png',
            'folder'         : 'storage/temp',
            'queueID'        : 'fileQueuefile',
            'auto'           : true,
            'multi'          : false,
			'buttonText'     : 'Abrir',
			onComplete: function(event, queueID, fileObj, response, data){
                    alert(queueID);setUploadFileTrue() ;
                }
			
        });		
        
	    if(jQuery)(
		  		   function(jQuery){
		  	 		   
		  		      jQuery.extend(jQuery.fn,{
		  		         uploadifyRemoveFromServer:function(ID, strFile) {
		  		          
		  		            $('#uploadimage').each(function() {
		  		                
		  		               $.post("scripts/remove.php", {
		  		                  'libformfileid': "uploadimage",
		  		                  'remove': strFile
		  		                  });
		  		               $("#uploadimage" + ID + " .percentage").text(' - Deleted');
		  		               $("#uploadimage" + ID).fadeOut(250, function() { jQuery(this).remove();});
			  		           $("#uploadimageUploader").attr("data","scripts/uploadify.swf");
		  		            });
		  		         }
		  		      });
		  		   }
		  		)(jQuery);  
        
    });
	


	
    </script>

	
</head>




<body>

	<div id="content">			
		
		<div id="top">
		
			<?php include("top.php");?>
			
			<?php 
				if(! isset( $_SESSION['userid'] ) )
				{ 
				    redirect('index.php'); 
				} 			
			?>
			
		</div>

		<div id="middle">
		
			<div id="middle_left">
            
            	<?php include("left.php");?>

			</div>
			
			<div id="middle_right">
            
            	                                
                <div id="uploadform">                   
                    <form enctype="multipart/form-data" action="uploader.php" method="post">
                    
                        T&iacute;tulo: 
                        <input type="text" name="Titulo" id="titulo" class=""  />
                        <br/><br/><br/>
                        Tipo: 
                        <?php include("lib/getTypes.php");?>											
                        <br/><br/><br/>
                        
                        Texto: 
                        <textarea name="Texto"  id="texto" rows="6" cols="80"></textarea>
                        <br/><br/><br/>
                        
                     
                         Imagem:
                       
                        <input type="file" name="uploadimage" id="uploadimage" />
                     
                        <div id="fileQueueimage"></div> 
                        
                        Arquivo: 
                        <input type="file" name="uploadfile" id="uploadfile" />
                        <div id="fileQueuefile"></div>                      
                        <br/>
                        Enviar: 
                        <input  name="Enviar" type="button" class="" value="Enviar" onclick="checkForm();" />
                        <br/><br/><br/>
                        
                       
                    
					</form>
                </div>
                
				
			</div>
		
		</div>

		<div id="bottom">

		</div>

	</div>
		

</body>

</html>